<template><div><p>本文档最新版为 <a href="https://learnku.com/docs/laravel/10.x" target="_blank" rel="noopener noreferrer">10.x</a>，旧版本可能放弃维护，推荐阅读最新版！</p>
<h2 id="契约-contract" tabindex="-1"><a class="header-anchor" href="#契约-contract"><span>契约（Contract）</span></a></h2>
<ul>
<li><a href="#introduction">简介</a>
<ul>
<li><a href="#contracts-vs-facades">Contract 对比 Facade</a></li>
</ul>
</li>
<li><a href="#when-to-use-contracts">何时使用 Contract</a></li>
<li><a href="#how-to-use-contracts">如何使用 Contract</a></li>
<li><a href="#contract-reference">Contract 参考</a></li>
</ul>
<h2 id="简介" tabindex="-1"><a class="header-anchor" href="#简介"><span>简介</span></a></h2>
<p>Laravel 的「契约（Contract）」是一组接口，它们定义由框架提供的核心服务。例如，<code v-pre>illuste\Contracts\Queue\Queue</code> Contract 定义了队列所需的方法，而 <code v-pre>illuste\Contracts\Mail\Mailer</code> Contract 定义了发送邮件所需的方法。</p>
<p>每个契约都有由框架提供的相应实现。例如，Laravel 提供了一个支持各种驱动的队列实现，还有一个由 <a href="https://symfony.com/doc/7.0/mailer.html" target="_blank" rel="noopener noreferrer">Symfony Mailer</a> 提供支持的邮件程序实现等等。</p>
<p>所有的 Laravel Contract 都存在于它们各自的 <a href="https://github.com/illuminate/contracts" target="_blank" rel="noopener noreferrer">GitHub 仓库</a>。这为所有可用的契约提供了一个快速的参考点，同时也可做为一个解耦的独立组件用于开发需要与 Laravel 交互的第三方包。</p>
<h3 id="contract-对比-facade" tabindex="-1"><a class="header-anchor" href="#contract-对比-facade"><span>Contract 对比 Facade</span></a></h3>
<p>Laravel 的 <a href="https://learnku.com/docs/laravel/11.x/facades" target="_blank" rel="noopener noreferrer">Facades</a> 和辅助函数提供了一种利用 Laravel 服务的简单方法，无需类型提示并可以从服务容器中解析 Contract。在大多数情况下，每个 Facade 都有一个等效的 Contract。</p>
<p>和 Facade（不需要在构造函数中引入）不同，Contract 允许你为类定义显式依赖关系。一些开发者更喜欢以这种方式显式定义其依赖项，所以更喜欢使用 Contract，而其他开发者则享受 Facade 带来的便利。<strong>通常，大多数应用都可以在开发过程中使用 Facade。</strong></p>
<h2 id="何时使用-contract" tabindex="-1"><a class="header-anchor" href="#何时使用-contract"><span>何时使用 Contract</span></a></h2>
<p>使用 Contract 或 Facades 取决于个人喜好和开发团队的喜好。Contract 和 Facade 均可用于创建功能强大且经过良好测试的 Laravel 应用。Contract 和 Facade 并不是一道单选题，你可以在同一个应用内同时使用 Contract 和 Facade。只要你在类中贯彻「单一职责」原则，你会发现 Contract 和 Facade 的实际差异其实很小。</p>
<p>通常情况下，大部分使用 Facade 的应用都不会在开发中遇到问题。但如果你在建立一个可以由多个 PHP 框架使用的扩展包，你可能会希望使用 <code v-pre>illuminate/contracts</code> 扩展包来定义该包和 Laravel 集成，而不需要引入完整的 Laravel 实现（不需要在 <code v-pre>composer.json</code> 中具体显式引入 Laravel 框架来实现）。</p>
<h2 id="如何使用-contract" tabindex="-1"><a class="header-anchor" href="#如何使用-contract"><span>如何使用 Contract</span></a></h2>
<p>那么，如何实现契约呢？它其实很简单。</p>
<p>Laravel 中的许多类都是通过 <a href="https://learnku.com/docs/laravel/11.x/container" target="_blank" rel="noopener noreferrer">服务容器</a> 解析的，包括控制器、事件侦听器、中间件、队列任务，甚至路由闭包。因此，要实现契约，你只需要在被解析的类的构造函数中写好「类型提示」接口。</p>
<p>例如，看看下面的这个事件监听器：</p>
<div class="language-php line-numbers-mode" data-highlighter="prismjs" data-ext="php" data-title="php"><pre v-pre class="language-php"><code><span class="line"><span class="token php language-php"><span class="token delimiter important">&lt;?php</span></span>
<span class="line"></span>
<span class="line"><span class="token keyword">namespace</span> <span class="token package">App<span class="token punctuation">\</span>Listeners</span><span class="token punctuation">;</span></span>
<span class="line"></span>
<span class="line"><span class="token keyword">use</span> <span class="token package">App<span class="token punctuation">\</span>Events<span class="token punctuation">\</span>OrderWasPlaced</span><span class="token punctuation">;</span></span>
<span class="line"><span class="token keyword">use</span> <span class="token package">App<span class="token punctuation">\</span>Models<span class="token punctuation">\</span>User</span><span class="token punctuation">;</span></span>
<span class="line"><span class="token keyword">use</span> <span class="token package">Illuminate<span class="token punctuation">\</span>Contracts<span class="token punctuation">\</span>Redis<span class="token punctuation">\</span>Factory</span><span class="token punctuation">;</span></span>
<span class="line"></span>
<span class="line"><span class="token keyword">class</span> <span class="token class-name-definition class-name">CacheOrderInformation</span></span>
<span class="line"><span class="token punctuation">{</span></span>
<span class="line">    <span class="token doc-comment comment">/**</span>
<span class="line">     * 创建一个新的事件监听器实例</span>
<span class="line">     */</span></span>
<span class="line">    <span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function-definition function">__construct</span><span class="token punctuation">(</span></span>
<span class="line">        <span class="token keyword">protected</span> <span class="token class-name type-declaration">Factory</span> <span class="token variable">$redis</span><span class="token punctuation">,</span></span>
<span class="line">    <span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span></span>
<span class="line"></span>
<span class="line">    <span class="token doc-comment comment">/**</span>
<span class="line">     * 处理该事件。</span>
<span class="line">     */</span></span>
<span class="line">    <span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function-definition function">handle</span><span class="token punctuation">(</span><span class="token class-name type-declaration">OrderWasPlaced</span> <span class="token variable">$event</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword return-type">void</span></span>
<span class="line">    <span class="token punctuation">{</span></span>
<span class="line">        <span class="token comment">// ...</span></span>
<span class="line">    <span class="token punctuation">}</span></span>
<span class="line"><span class="token punctuation">}</span></span>
<span class="line"></span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>当解析事件监听器时，服务容器将读取构造函数上的类型提示，并注入适当的值。 要了解更多有关在服务容器中注册内容的信息，请查看 <a href="https://learnku.com/docs/laravel/11.x/container" target="_blank" rel="noopener noreferrer">其文档</a>.</p>
<h2 id="contract-参考" tabindex="-1"><a class="header-anchor" href="#contract-参考"><span>Contract 参考</span></a></h2>
<p>下表提供了所有 Laravel Contract 及对应的 Facade 的便捷参考：</p>
<table>
<thead>
<tr>
<th>Contract</th>
<th>对应的 Facade</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Auth/Access/Authorizable.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Auth\Access\Authorizable</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Auth/Access/Gate.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Auth\Access\Gate</a></td>
<td><code v-pre>Gate</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Auth/Authenticatable.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Auth\Authenticatable</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Auth/CanResetPassword.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Auth\CanResetPassword</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Auth/Factory.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Auth\Factory</a></td>
<td><code v-pre>Auth</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Auth/Guard.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Auth\Guard</a></td>
<td><code v-pre>Auth::guard()</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Auth/PasswordBroker.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Auth\PasswordBroker</a></td>
<td><code v-pre>Password::broker()</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Auth/PasswordBrokerFactory.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Auth\PasswordBrokerFactory</a></td>
<td><code v-pre>Password</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Auth/StatefulGuard.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Auth\StatefulGuard</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Auth/SupportsBasicAuth.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Auth\SupportsBasicAuth</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Auth/UserProvider.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Auth\UserProvider</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Bus/Dispatcher.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Bus\Dispatcher</a></td>
<td><code v-pre>Bus</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Bus/QueueingDispatcher.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Bus\QueueingDispatcher</a></td>
<td><code v-pre>Bus::dispatchToQueue()</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Broadcasting/Factory.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Broadcasting\Factory</a></td>
<td><code v-pre>Broadcast</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Broadcasting/Broadcaster.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Broadcasting\Broadcaster</a></td>
<td><code v-pre>Broadcast::connection()</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Broadcasting/ShouldBroadcast.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Broadcasting\ShouldBroadcast</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Broadcasting/ShouldBroadcastNow.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Broadcasting\ShouldBroadcastNow</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Cache/Factory.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Cache\Factory</a></td>
<td><code v-pre>Cache</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Cache/Lock.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Cache\Lock</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Cache/LockProvider.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Cache\LockProvider</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Cache/Repository.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Cache\Repository</a></td>
<td><code v-pre>Cache::driver()</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Cache/Store.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Cache\Store</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Config/Repository.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Config\Repository</a></td>
<td><code v-pre>Config</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Console/Application.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Console\Application</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Console/Kernel.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Console\Kernel</a></td>
<td><code v-pre>Artisan</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Container/Container.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Container\Container</a></td>
<td><code v-pre>App</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Cookie/Factory.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Cookie\Factory</a></td>
<td><code v-pre>Cookie</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Cookie/QueueingFactory.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Cookie\QueueingFactory</a></td>
<td><code v-pre>Cookie::queue()</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Database/ModelIdentifier.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Database\ModelIdentifier</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Debug/ExceptionHandler.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Debug\ExceptionHandler</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Encryption/Encrypter.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Encryption\Encrypter</a></td>
<td><code v-pre>Crypt</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Events/Dispatcher.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Events\Dispatcher</a></td>
<td><code v-pre>Event</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Filesystem/Cloud.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Filesystem\Cloud</a></td>
<td><code v-pre>Storage::cloud()</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Filesystem/Factory.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Filesystem\Factory</a></td>
<td><code v-pre>Storage</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Filesystem/Filesystem.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Filesystem\Filesystem</a></td>
<td><code v-pre>Storage::disk()</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Foundation/Application.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Foundation\Application</a></td>
<td><code v-pre>App</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Hashing/Hasher.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Hashing\Hasher</a></td>
<td><code v-pre>Hash</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Http/Kernel.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Http\Kernel</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Mail/MailQueue.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Mail\MailQueue</a></td>
<td><code v-pre>Mail::queue()</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Mail/Mailable.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Mail\Mailable</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Mail/Mailer.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Mail\Mailer</a></td>
<td><code v-pre>Mail</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Notifications/Dispatcher.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Notifications\Dispatcher</a></td>
<td><code v-pre>Notification</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Notifications/Factory.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Notifications\Factory</a></td>
<td><code v-pre>Notification</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Pagination/LengthAwarePaginator.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Pagination\LengthAwarePaginator</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Pagination/Paginator.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Pagination\Paginator</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Pipeline/Hub.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Pipeline\Hub</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Pipeline/Pipeline.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Pipeline\Pipeline</a></td>
<td><code v-pre>Pipeline</code>;</td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Queue/EntityResolver.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Queue\EntityResolver</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Queue/Factory.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Queue\Factory</a></td>
<td><code v-pre>Queue</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Queue/Job.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Queue\Job</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Queue/Monitor.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Queue\Monitor</a></td>
<td><code v-pre>Queue</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Queue/Queue.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Queue\Queue</a></td>
<td><code v-pre>Queue::connection()</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Queue/QueueableCollection.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Queue\QueueableCollection</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Queue/QueueableEntity.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Queue\QueueableEntity</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Queue/ShouldQueue.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Queue\ShouldQueue</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Redis/Factory.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Redis\Factory</a></td>
<td><code v-pre>Redis</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Routing/BindingRegistrar.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Routing\BindingRegistrar</a></td>
<td><code v-pre>Route</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Routing/Registrar.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Routing\Registrar</a></td>
<td><code v-pre>Route</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Routing/ResponseFactory.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Routing\ResponseFactory</a></td>
<td><code v-pre>Response</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Routing/UrlGenerator.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Routing\UrlGenerator</a></td>
<td><code v-pre>URL</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Routing/UrlRoutable.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Routing\UrlRoutable</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Session/Session.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Session\Session</a></td>
<td><code v-pre>Session::driver()</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Support/Arrayable.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Support\Arrayable</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Support/Htmlable.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Support\Htmlable</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Support/Jsonable.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Support\Jsonable</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Support/MessageBag.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Support\MessageBag</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Support/MessageProvider.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Support\MessageProvider</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Support/Renderable.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Support\Renderable</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Support/Responsable.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Support\Responsable</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Translation/Loader.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Translation\Loader</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Translation/Translator.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Translation\Translator</a></td>
<td><code v-pre>Lang</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Validation/Factory.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Validation\Factory</a></td>
<td><code v-pre>Validator</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Validation/ImplicitRule.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Validation\ImplicitRule</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Validation/Rule.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Validation\Rule</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Validation/ValidatesWhenResolved.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Validation\ValidatesWhenResolved</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/Validation/Validator.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\Validation\Validator</a></td>
<td><code v-pre>Validator::make()</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/View/Engine.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\View\Engine</a></td>
<td></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/View/Factory.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\View\Factory</a></td>
<td><code v-pre>View</code></td>
</tr>
<tr>
<td><a href="https://github.com/illuminate/contracts/blob/laravel/11.x/View/View.php" target="_blank" rel="noopener noreferrer">Illuminate\Contracts\View\View</a></td>
<td><code v-pre>View::make()</code></td>
</tr>
</tbody>
</table>
<p>本文章首发在 <a href="https://learnku.com/" target="_blank" rel="noopener noreferrer">LearnKu.com</a> 网站上。</p>
<blockquote>
<p>本译文仅用于学习和交流目的，转载请务必注明文章译者、出处、和本文链接<br>
我们的翻译工作遵照 <a href="https://learnku.com/docs/guide/cc4.0/6589" target="_blank" rel="noopener noreferrer">CC 协议</a>，如果我们的工作有侵犯到您的权益，请及时联系我们。</p>
</blockquote>
<hr>
<blockquote>
<p>原文地址：<a href="https://learnku.com/docs/laravel/11.x/contractsmd/16676" target="_blank" rel="noopener noreferrer">https://learnku.com/docs/laravel/11.x/co...</a></p>
<p>译文地址：<a href="https://learnku.com/docs/laravel/11.x/contractsmd/16676" target="_blank" rel="noopener noreferrer">https://learnku.com/docs/laravel/11.x/co...</a></p>
</blockquote>
</div></template>


